<template>
    <div class="app-nav">
        <ul>
            <router-link to="/" tag="li" key="0">首页</router-link>
            <router-link :to="'/category/'+item.id" tag="li" v-for="(item,index) in test" key="index">{{item.description}}</router-link>
        </ul>
    </div>
</template>

<script>
    export default {
      data () {
        return {
          url: '/api/test',
          test: []
        }
      },
      created () {
        let that = this
        that.$http({
          url: that.url,
          method: 'get'
        }).then(function (data) {
          console.log(data)
          that.test = data.data.data
        })
      }
    }
</script>